<section class="container">
  <div class="row"> 
    <%= render BlockScoutWeb.Account.CommonView, "_nav.html", conn: @conn, active_item: :watchlist %>
    <div class="col-md">
      <div class="card">
        <div class="card-body" >
          <h1 class="card-title list-title-description header-account"><%= gettext "Watch list" %></h1>
          <br>
          <div class="col-sm">
            <div class="mb-4 row o-flow-x">
              <%= if @watchlist.watchlist_addresses == [] do %>
              <div style="min-width: 100%;">
                <div class="tile tile-muted text-center" data-selector="empty-coin-balances-list">
                  <%= gettext "You don't have addresses on you watchlist yet" %>
                </div>
              </div>
                <h2></h2>
              <% else %>
                <table class="table mb-4 table-watchlist">
                  <thead style="font-size: 14px; color: #6c757d" >
                    <tr>
                      <th scope="col"><%= gettext "Name" %></th>
                      <th scope="col"><%= gettext "Address" %></th>
                      <th scope="col"><%= gettext "Balance" %></th>
                      <th scope="col"><%= gettext "Actions" %></th>
                    </tr>
                  </thead>
                  <tbody style="font-size: 15px; color: #6c757d" >
                    <%= Enum.map(@watchlist.watchlist_addresses, fn wa ->
                      render(WatchlistAddressView, "row.html", watchlist_address: wa, exchange_rate: exchange_rate(), conn: @conn)
                      end) %>
                  </tbody>
                </table>
              <% end %>
            </div>
          </div>
          <%= if Enum.count(@watchlist.watchlist_addresses) < WatchlistAddress.get_max_watchlist_addresses_count() do %>
            <a class="add-address-button button button-primary button-sm" href="<%= watchlist_address_path(@conn, :new) %>"><%= gettext "Add address" %></a>
          <% end %>
        </div>
      </div>
</section>
